<div ng-controller="PintuanCtrl" ng-init="addAction()">
    <ul class="sui-breadcrumb">
        <li><a href="#/pintuan/list">{{pintuan_data.name?pintuan_data.name:'砍价'}}</a></li>
        <li class="active">
            {{!pintuan_id ?"创建":"edit"|translate}}
        </li>
    </ul>
    <form name="Tradeform" class="sui-form form-horizontal" novalidate>
        <div mywizard class="sui-steps">
            <step>
                <label><span class="round">1</span><span>活动设置</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">2</span><span>设置商品</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <step>
                <label><span class="round">3</span><span>完成</span></label>
                <i class="triangle-right-bg"></i><i class="triangle-right"></i>
            </step>
            <div stepcontent0 class="stepContent">
                <div class="stepbody">
                    <div class="control-group">
                        <label class="control-label v-top">
                            活动名称：
                        </label>
                        <div class="controls">
                            <input id="name" type="text" name="name" ng-model="pintuan_data.name" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            起始时间：
                        </label>
                        <div class="controls">
                            <input id="start_time" ng-model="pintuan_data.start_time" datetimepicker name="start_time" required>
                            <span class="float_left" style="width:10px;">至</span>
                            <input id="end_time" ng-model="pintuan_data.end_time" datetimepicker name="end_time" min-date="{{pintuan_data.start_time}}" required>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            需要几人团：
                        </label>
                        <div class="controls">
                            <input name="need_customer_num" type="number" ng-model="pintuan_data.need_customer_num" required> 个
                            <div ng-show="pintuan_data.need_customer_num < 2" class="sui-msg msg-error msg-clear help-block error">
                                <div class="msg-con">拼团人数最少2人</div>
                                <s class="msg-icon"></s>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label v-top">
                            过期时间：
                        </label>
                        <div class="controls" ng-if="pintuan_data">
                            <expirationt-time ng-model="pintuan_data.expiration_hour"></expirationt-time> 小时
                            <div ng-show="!pintuan_data.expiration_hour" class="sui-msg msg-error msg-clear help-block error">
                                <div class="msg-con">过期时间不能为空</div>
                                <s class="msg-icon"></s>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" id="next1" class="sui-btn btn-primary" mywizard-next>{{'Next step'|translate}}</button>
                </div>
            </div>
            <div stepcontent1 class="stepContent">
                <div class="stepbody">
                    <div class="control-group">
                        <choice-item item-check="itemdata(items)" mult="no" out-html="yes" class="{{pintuan_id?'zhide':''}}" num="1"></choice-item> <span style="color: red;">（拼团商品只能是单规格，多规格无法创建拼团）</span>
                        <table class="sui-table table-bordered" ng-show="checked_item" style="margin-top: 10px;">
                            <thead>
                                <tr>
                                    <th>{{"item_image"|translate}} </th>
                                    <th>{{"title"|translate}} </th>
                                    <th>sku</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><img ng-src="{{checked_item.img}}" class="item-image-80" /></td>
                                    <td>
                                        {{checked_item.title}}
                                        <br> {{checked_item.outer_id}}
                                    </td>
                                    <td style="padding:0px;">
                                        <table class="sui-table table-nobordered" style="margin:0px;">
                                            <thead>
                                                <tr>
                                                    <th>＃</th>
                                                    <th>{{"sku_properties"|translate}} </th>
                                                    <th>{{"skus_id"|translate}} </th>
                                                    <th>{{"价格"|translate}}</th>
                                                    <th>{{"remark"|translate}} </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <tr>
                                                    <td>
                                                        <div ng-if="!isChoseItem">
                                                            <!-- <input ng-show="!ismult" type="radio" name="radio2" ng-click="isChecked(item,sku)">
                                                        <input ng-show="ismult" type="checkbox" name="checkbox2" checklist-model="chosedItems" checklist-value="itemSku[item.item_id+'_'+sku.sku_id]"> -->
                                                        </div>
                                                    </td>
                                                    <td>{{checked_item.sku_data.sku_properties}}</td>
                                                    <td>{{checked_item.sku_data.sku_outer_id}}</td>
                                                    <td>{{checked_item.sku_data.sku_price}}</td>
                                                    <td>{{checked_item.sku_data.remark}}</td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="control-group" ng-show="checked_item">
                        <label class="control-label v-top">
                            原价:
                        </label>
                        <div class="controls">
                            {{pintuan_data.original_price}} 元
                            <span ng-if="oldsku_price !== pintuan_data.original_price" class="sui-text-warning">
                                (上次创建价格{{oldsku_price}} 元)
                            </span>
                        </div>
                    </div>
                    <div class="control-group" ng-show="checked_item">
                        <label class="control-label v-top">
                            拼团价
                        </label>
                        <div class="controls">
                            <input name="pin_price" type="number" ng-model="pintuan_data.pin_price"> 元
                            <div ng-show="pintuan_data.pin_price >pintuan_data.original_price" class="sui-msg msg-error msg-clear help-block error">
                                <div class="msg-con">拼团价格不能大于原价</div>
                                <s class="msg-icon"></s>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <button type="button" class="sui-btn btn-primary" mywizard-previous>上一步</button>
                    <button id="pintuanAdd" class="sui-btn btn-primary" ng-disabled="!pintuan_data.item_id && !pintuan_data.sku_id" ng-click="pintuanAdd();">
                        保存
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>